package ee.videorentalstore.protocols.commands.changingsystemusercommands;

import ee.videorentalstore.protocols.commands.Command;
import ee.videorentalstore.users.UsersDatabase;
import ee.videorentalstore.users.types.Customer;

public class GetListOfAllCustomersCommand extends Command
{
	@Override
	public String getCommandDescription()
	{
		return "GET LIST OF ALL CUSTOMERS";
	}
	
	
	@Override
	public void executeCommand(String inputStreamInstructionsToProcess) 
	{
		if (!UsersDatabase.getInstance().getAllCustomers().isEmpty())
		{
			for (Customer customer : UsersDatabase.getInstance().getAllCustomers())
			{
				System.out.println("Customer ID: " + customer.getUserID() + "\n" +
								   "Customer name: " + customer.getUserName());
				System.out.println();
			}
		}
		else
		{
			System.out.println("There are no customers registered yet!");
		}
	}
}
